import { stringify } from 'qs';
import request from '../utils/request';

export async function saveOrUpdateSpread(params) {
  return request(
    `/api/web/spread/saveOrUpdateSpread?${stringify(params)}`,{
    method: 'POST',
    body: {
      ...params,
      method: 'post',
    },
  });
}

export async function listSpreadByType(params) {
  return request(`/api/web/spread/listSpreadByType?${stringify(params)}`);
}

export async function delSpread(params) {
  return request(`/api/web/spread/delSpread?${stringify(params)}`);
}

export async function listSpreadForShake(params) {
  return request(`/api/web/spread/listSpreadForShake?${stringify(params)}`);
}

export async function listSpreadResult(params) {
  return request(`/api/web/spreadContent/listSpreadResult?${stringify(params)}`);
}

export async function getSpreadById(params) {
  return request(`/api/web/spread/getSpreadInfoById?${stringify(params)}`);
}

export async function listPluginCouponResult(params) {
  return request(`/api/web/pluginCouponResult/listPluginCouponResult?${stringify(params)}`);
}
